Por causa de contaminação das amostras, terei que calcular novamente as métricas de alpha e beta diversidade, returando as amostras contaminadas
print(colnames(asv_table))
[1] "#OTU ID" "NEG-Kit-Run5" "NEG-Run1" "NEG-Run2"
[5] "NEG-Run3" "NEG-Run4" "NEG-Run5" "Pooled-ExtCont-NEG"
[9] "Pooled-ExtCont-POS-MOCK" "POSZymo-Run1" "S10011-F00" "S10011-F01"
[13] "S10012-F00" "S10012-F01" "S10021-F00" "S10021-F01"
[17] "S10031-F00" "S10031-F01" "S10041-F00" "S10041-F01"
[21] "S10051-F00" "S10051-F01" "S10052-F00" "S10052-F01"
[25] "S10061-F00" "S10061-F01" "S10062-F00" "S10062-F01"
[29] "S10091-F00" "S10091-F01" "S10092-F00" "S10092-F01"
[33] "S10111-F00" "S10111-F01" "S10121-F00" "S10121-F01"
[37] "S10122-F00" "S10122-F01" "S10131-F00" "S10131-F01"
[41] "S10141-F00" "S10141-F01" "S10142-F00" "S10142-F01"
[45] "S10161-F00" "S10161-F01" "S10171-F00" "S10171-F01"
[49] "S10172-F00" "S10181-F00" "S10201-F00" "S10202-F00"
[53] "S10211-F00" "S10212-F00" "S10221-F00" "S10231-F00"
[57] "S10232-F00" "S10241-F00" "S10242-F00" "S10261-F00"
[61] "S10271-F00" "S10272-F00" "S10281-F00" "S10291-F00"
[65] "S10301-F00" "S10311-F00" "S10312-F00" "S10321-F00"
[69] "S10331-F00" "S10332-F00" "S10341-F00" "S10342-F00"
[73] "S10361-F00" "S10362-F00" "S10371-F00" "S10372-F00"
[77] "S10381-F00" "S10391-F00" "S10401-F00" "S20011-F00"
[81] "S20041-F00" "S20042-F00" "S20061-F00" "S20081-F00"
[85] "S20091-F00" "S20092-F00" "S20101-F00" "S20240125-PCRNEG"
[89] "S20240131-PCRNEG" "S20240319-PCRNEG" "S30011-F00" "S30021-F00"
[93] "S30031-F00" "S30032-F00" "S30041-F00" "S30042-F00"
[97] "S30051-F00" "S30052-F00" "S30061-F00" "S30081-F00"
[101] "S30091-F00" "S30092-F00" "S30101-F00" "S30112-F00"
[105] "S30121-F00" "S30122-F00" "S30131-F00" "S30171-F00"
[109] "S30181-F00" "S30211-F00" "S30231-F00" "S30241-F00"
[113] "S30261-F00" "S40011-F00" "S40012-F00" "S40022-F00"
[117] "S40031-F00" "S40061-F00" "S40062-F00" "S40091-F00"
[121] "S40092-F00" "S40101-F00" "S40111-F00" "S40112-F00"
[125] "S40121-F00" "S40131-F00" "S40132-F00" "S40141-F00"
[129] "S40142-F00" "S40151-F00" "S40191-F00" "S40201-F00"
[133] "S40241-F00" "S40251-F00" "S40281-F00" "S40311-F00"
[137] "S40321-F00" "S40331-F00" "S40351-F00" "S40361-F00"
[141] "S40371-F00" "S40401-F00" "S40411-F00" "S40471-F00"
[145] "S40481-F00" "S40521-F00" "S40531-F00" "S40541-F00"
[149] "S40551-F00" "S40581-F00" "S40591-F00" "S40601-F00"
[153] "S40611-F00" "S40621-F00" "S40631-F00" "S40641-F00"
[157] "S40651-F00" "S40681-F00" "S40691-F00" "S40711-F00"
[161] "S40851-F00" "S40861-F00"
otu_table
OTU Table: [3972 taxa and 109 samples]
taxa are rows
S10011.F00 S10012.F00 S10021.F00 S10031.F00 S10041.F00 S10051.F00 S10052.F00 S10061.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 999 5 8 110 0 469 1810 0
S10062.F00 S10091.F00 S10092.F00 S10111.F00 S10121.F00 S10122.F00 S10131.F00 S10141.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 513 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 112 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 0 8 387 0 0 864 450 0
S10142.F00 S10161.F00 S10171.F00 S10172.F00 S10181.F00 S10201.F00 S10202.F00 S10211.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 0 0 131 0 9 0 71 0
S10212.F00 S10221.F00 S10231.F00 S10232.F00 S10241.F00 S10242.F00 S10261.F00 S10271.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 75 0 0
c4f0710eb90cbedb839c238b591f4bb9 0 8 8 12 1195 743 0 0
S10272.F00 S10281.F00 S10291.F00 S10301.F00 S10311.F00 S10312.F00 S10321.F00 S10331.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 667 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 17 89 313 109 16 0 11 403
S10332.F00 S10341.F00 S10342.F00 S10361.F00 S10362.F00 S10371.F00 S10372.F00 S10381.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 69
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 385 6 65 106 11 0 0 0
S10391.F00 S10401.F00 S20011.F00 S20041.F00 S20042.F00 S20061.F00 S20081.F00 S20091.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 104 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 83 8 0 0 0 0 7 46
S20092.F00 S20101.F00 S30011.F00 S30021.F00 S30031.F00 S30032.F00 S30041.F00 S30042.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 88 0
c4f0710eb90cbedb839c238b591f4bb9 230 9 11 9 27 0 133 102
S30051.F00 S30052.F00 S30061.F00 S30081.F00 S30091.F00 S30092.F00 S30101.F00 S30112.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 0 11 3 0 0 5 6 10
S30121.F00 S30122.F00 S30131.F00 S30171.F00 S30181.F00 S30211.F00 S30231.F00 S30241.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 109 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 82 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 0 0 0 198 138 278 0 12
S30261.F00 S40011.F00 S40012.F00 S40022.F00 S40031.F00 S40061.F00 S40062.F00 S40091.F00
600523c05a9a7b2d1d60a0743aaa97ac 13 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 181 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 69 0 92 6 0 9 0 0
S40092.F00 S40101.F00 S40111.F00 S40112.F00 S40121.F00 S40131.F00 S40132.F00 S40141.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 31
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 7 12 12 6 13 0 0 0
S40142.F00 S40151.F00 S40191.F00 S40201.F00 S40241.F00 S40251.F00 S40281.F00 S40311.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 263 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 49 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 16 584 17 16 0 9 0 509
S40321.F00 S40331.F00 S40351.F00 S40361.F00 S40371.F00
600523c05a9a7b2d1d60a0743aaa97ac 0 0 0 0 0
baa3863ba271627607671309a3661284 0 0 0 0 0
27335f508429bf2100f5dded19cea135 0 0 0 0 0
45ea54bf5613093b3b9ffb9e2e8f41cf 0 0 0 0 0
621492842a9298d79db8d956f546cd46 0 0 0 0 0
28026d88093b7c61eb0a6166528927d9 0 0 0 0 0
6f2ec062590d01ec1b4e10d924b65b4b 0 0 0 0 0
b7564d67de929efae3304def5333f0b0 0 0 0 0 0
c4f0710eb90cbedb839c238b591f4bb9 149 124 6 135 7
[ reached getOption("max.print") -- omitted 3963 rows ]
#criar objeto phyloseq
physeq_obj <- phyloseq(otu_table)
otu_table(physeq_obj)
phy_tree(physeq_obj) # Deve mostrar a árvore
sample_names(physeq_obj) # Deve retornar os nomes das amostras
taxa_names(physeq_obj) # Deve retornar os nomes dos ASVs
rank_names(physeq_obj) # Verifica se há tabela taxonômica associada
# IDs das ASVs na OTU Table
otu_ids <- taxa_names(physeq_obj)
# IDs na tabela de taxonomia
taxa_ids <- taxonomy$Feature.ID
# IDs das amostras na OTU Table e Metadata
sample_ids_otu <- sample_names(otu_table)
sample_ids_meta <- row.names(metadata)
# Verificações
sum(taxa_ids %in% otu_ids) # Deve ser igual ao número de linhas da taxonomia
sum(sample_ids_meta %in% sample_ids_otu) # Deve ser igual ao número de amostras
rownames(taxonomy) <- taxonomy$Feature.ID # Define os nomes das linhas como IDs das ASVs
taxonomy <- taxonomy[, -1] # Remove a coluna original "Feature.ID"
# Criar os componentes do phyloseq
otu_table_ps <- otu_table(otu_table, taxa_are_rows = TRUE)
tax_table_ps <- tax_table(as.matrix(taxonomy))
sample_data_ps <- sample_data(metadata)
phy_tree_ps <- phy_tree(tree)
physeq_obj <- phyloseq(otu_table_ps,
tax_table_ps,
phy_tree_ps)
# Verifique os IDs das OTUs na matriz de abundância
otu_ids <- taxa_names(otu_table_ps)
# Verifique os IDs na tabela taxonômica
taxa_ids <- taxa_names(tax_table_ps)
# Verifique os IDs na árvore filogenética
tree_ids <- phy_tree(phy_tree_ps)$tip.label
# Veja quantas OTUs da tabela estão na taxonomia
sum(otu_ids %in% taxa_ids) # Deve ser igual ao número de OTUs
# Veja quantas OTUs da árvore estão na matriz OTU
sum(otu_ids %in% tree_ids) # Deve ser igual ao número de OTUs
# Veja quantas OTUs da árvore estão na taxonomia
sum(tree_ids %in% taxa_ids) # Deve ser igual ao número de OTUs
# Verifica a saída
print(wei_unifrac.pcoa)
$points
[,1] [,2] [,3]
S10011.F00 -0.088589422 -0.003407316 -0.013129649
S10012.F00 -0.088692093 -0.078534474 -0.024555689
S10021.F00 -0.083077443 -0.072345597 -0.006698774
S10031.F00 0.106527844 0.061915388 0.020909570
S10041.F00 -0.063544504 0.016296597 -0.007229302
S10051.F00 0.248474596 0.051084886 -0.003837505
S10052.F00 -0.090415698 -0.006857413 -0.009174442
S10061.F00 -0.076508001 -0.047054724 0.014144953
S10062.F00 -0.149584724 -0.116086800 0.086306784
S10091.F00 -0.029143935 -0.042435574 -0.062271699
S10092.F00 0.052511202 0.115969794 0.061451045
S10111.F00 0.035789242 0.077251367 0.057384770
S10121.F00 0.008390579 -0.039891947 -0.016859117
S10122.F00 0.038584340 0.021070482 0.079366855
S10131.F00 0.195887724 0.026439210 0.119536025
S10141.F00 -0.143552428 -0.083312748 0.049052709
S10142.F00 0.064480711 0.147038459 -0.008645180
S10161.F00 -0.051702286 0.107030282 -0.024419076
S10171.F00 0.373309424 -0.047061219 -0.046161173
S10172.F00 -0.130389974 -0.056081602 0.011203673
S10181.F00 0.294519768 -0.023387555 -0.037522560
S10201.F00 0.138695017 0.010182844 0.120690689
S10202.F00 -0.014012458 0.028400329 -0.034784218
S10211.F00 -0.031114303 0.007722465 -0.044581110
S10212.F00 -0.055955435 -0.053651302 -0.069518470
S10221.F00 -0.055984399 0.010218150 0.001259086
S10231.F00 -0.082315166 -0.117426380 0.039141509
S10232.F00 0.026126737 -0.074126775 -0.009626500
S10241.F00 -0.173713646 0.072886069 -0.124057807
S10242.F00 -0.053099752 -0.055469366 -0.028320443
S10261.F00 0.490751496 -0.110535519 -0.074572230
S10271.F00 -0.067451786 -0.035537044 0.022422227
S10272.F00 -0.075804495 -0.067822172 -0.021600889
S10281.F00 0.340380893 -0.013978411 0.045632276
S10291.F00 -0.068935791 0.076677924 0.028703810
S10301.F00 -0.096069403 0.157766766 -0.059694736
S10311.F00 -0.045644643 -0.081190646 -0.095747983
S10312.F00 -0.077336147 -0.068927513 -0.049565988
S10321.F00 0.034313627 -0.042773613 0.126178318
S10331.F00 -0.074220507 -0.042146232 -0.044889656
S10332.F00 -0.106346023 0.049042527 0.043386747
S10341.F00 0.127190111 0.079337899 0.133803634
S10342.F00 0.017353847 0.092780623 -0.024145592
S10361.F00 0.430288580 -0.055287048 -0.023087301
S10362.F00 -0.089925996 -0.062682275 0.068557109
S10371.F00 -0.054808708 0.021121718 -0.052965940
S10372.F00 0.099460752 0.036093120 0.076373491
S10381.F00 0.438562940 -0.062816212 -0.047737010
S10391.F00 -0.071203206 -0.027324688 0.011706624
S10401.F00 0.329146749 -0.018638971 -0.008957834
S20011.F00 0.235062084 -0.015613307 -0.002783974
S20041.F00 -0.166453174 -0.113007884 0.036187473
S20042.F00 -0.072004527 0.105500267 0.069570566
S20061.F00 -0.068558181 -0.076072559 -0.065117127
S20081.F00 -0.097920740 0.041349210 -0.067833253
S20091.F00 -0.113826076 0.010554203 0.003850442
S20092.F00 -0.130090296 0.004153774 0.083516069
S20101.F00 0.091848451 0.027632948 0.107064736
S30011.F00 -0.046387555 -0.049108775 0.148462477
S30021.F00 -0.156449282 0.145041161 -0.147535610
S30031.F00 -0.016538220 0.109562751 -0.017040916
S30032.F00 0.025084766 0.054379506 -0.041709654
S30041.F00 -0.005260126 0.035066881 0.122222700
S30042.F00 0.026858447 0.061825142 -0.041340343
S30051.F00 -0.126744517 0.088877865 -0.016368799
S30052.F00 -0.081138449 -0.088895435 -0.036536465
S30061.F00 -0.100943679 0.018340981 0.025483064
S30081.F00 -0.084408000 0.041299758 -0.050130810
S30091.F00 -0.079291176 -0.052703966 -0.050249295
S30092.F00 -0.060194736 -0.103468636 -0.049177188
S30101.F00 -0.099362790 -0.015432469 -0.054303524
S30112.F00 -0.066063911 -0.068774333 0.029485594
S30121.F00 -0.136008165 0.026725765 0.071508931
S30122.F00 -0.011332515 0.020179537 -0.047988851
S30131.F00 -0.070357504 -0.001215586 0.017338882
S30171.F00 -0.025167952 0.043915870 -0.026258021
S30181.F00 -0.103669760 0.004867006 -0.012492274
S30211.F00 0.019263527 0.037396311 -0.002004864
S30231.F00 -0.069784934 -0.061711318 0.073289098
S30241.F00 -0.058894331 0.052253977 -0.076587374
S30261.F00 -0.079773140 0.137797332 -0.002482878
S40011.F00 -0.018026447 -0.027781239 -0.031031082
S40012.F00 -0.024420854 -0.018718516 0.048117054
S40022.F00 -0.007158355 -0.028632954 -0.051167954
S40031.F00 -0.068143351 0.050522767 0.043473851
S40061.F00 0.407646753 -0.020771489 -0.065987535
S40062.F00 0.078887676 0.045541604 0.034133001
S40091.F00 0.145227821 0.058905240 -0.013657784
S40092.F00 -0.083676521 -0.074720462 0.019943114
S40101.F00 -0.051982580 -0.011480906 0.027984576
S40111.F00 0.135002449 -0.001941472 0.065747485
S40112.F00 -0.021782459 -0.015955556 -0.051637089
S40121.F00 -0.160088447 -0.122327869 0.082114704
S40131.F00 -0.074159844 0.169883663 0.029724331
S40132.F00 -0.071953850 -0.072015406 -0.067444258
S40141.F00 0.197646888 0.075860128 -0.008968533
S40142.F00 -0.088256828 0.061854688 -0.049702575
S40151.F00 0.155448800 0.016659720 0.033096677
S40191.F00 -0.009055095 -0.015715732 -0.058165168
S40201.F00 -0.065314325 -0.045328400 -0.025487315
S40241.F00 0.062551844 -0.002590209 0.051251954
S40251.F00 -0.098692597 0.049852116 -0.014781209
S40281.F00 0.009079053 -0.066041303 -0.068147454
S40311.F00 -0.103092311 0.003971412 0.090603908
S40321.F00 -0.113017397 0.054847945 -0.065585045
S40331.F00 0.278528553 0.038570266 -0.041215441
S40351.F00 -0.066627465 -0.070295715 -0.013704204
S40361.F00 -0.150765014 -0.049705244 0.023710765
S40371.F00 -0.066903443 -0.062698815 -0.046111624
$eig
[1] 2.222728e+00 4.730517e-01 3.626951e-01 3.455379e-01 2.231193e-01
[6] 1.882328e-01 1.461547e-01 1.247226e-01 1.168983e-01 1.030639e-01
[11] 8.335171e-02 7.634735e-02 6.641816e-02 5.899381e-02 5.591415e-02
[16] 5.325374e-02 4.634694e-02 3.921030e-02 3.784627e-02 3.569156e-02
[21] 3.202157e-02 3.056241e-02 2.960253e-02 2.750287e-02 2.601631e-02
[26] 2.379762e-02 2.048767e-02 2.023302e-02 1.809227e-02 1.642083e-02
[31] 1.586069e-02 1.462312e-02 1.336014e-02 1.267728e-02 1.231572e-02
[36] 1.132968e-02 1.110117e-02 1.008923e-02 8.812017e-03 8.062022e-03
[41] 7.757816e-03 7.250806e-03 6.638025e-03 5.805382e-03 5.564750e-03
[46] 4.846028e-03 4.678191e-03 4.246937e-03 3.640047e-03 3.565292e-03
[51] 3.136357e-03 2.818486e-03 2.264425e-03 2.190688e-03 1.654698e-03
[56] 1.348096e-03 1.032210e-03 6.581071e-04 1.918236e-04 6.962400e-05
[61] -1.318390e-16 -2.108192e-04 -3.961426e-04 -9.023950e-04 -1.120517e-03
[66] -1.164091e-03 -1.387415e-03 -1.590231e-03 -1.975090e-03 -2.301677e-03
[71] -2.681113e-03 -2.950790e-03 -3.142725e-03 -3.283369e-03 -3.587875e-03
[76] -3.778945e-03 -4.229964e-03 -4.333097e-03 -4.600572e-03 -4.782558e-03
[81] -5.188532e-03 -5.436399e-03 -5.876379e-03 -5.983191e-03 -6.224817e-03
[86] -6.585694e-03 -6.925668e-03 -7.332196e-03 -7.793266e-03 -8.422376e-03
[91] -8.796997e-03 -9.899529e-03 -1.012066e-02 -1.058667e-02 -1.077344e-02
[96] -1.097755e-02 -1.250694e-02 -1.383964e-02 -1.506338e-02 -1.585506e-02
[101] -1.648595e-02 -1.793758e-02 -2.011989e-02 -2.032652e-02 -2.295180e-02
[106] -2.591649e-02 -3.074788e-02 -3.387381e-02 -5.145597e-02
$x
NULL
$ac
[1] 0
$GOF
[1] 0.5305865 0.5779535
res_unweighted
[1] "PERMANOVA: R² = 0.015, p = 0.037"
res_weighted
[1] "PERMANOVA: R² = 0.018, p = 0.082"
ggplot(merge(wei_unifrac.pcoa$points, metadata, by.x = "row.names", by.y = "Sample.id")) +
geom_point(aes(x = V1, y = V2, color = IMC), size = 3) +
scale_color_viridis_c(option = "C", name = "BMI") +
labs(title = paste("Weighted UniFrac", res_weighted),
x = "PCoA1", y = "PCoA2") +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cls8qba63pmhl_t/9a7117c5d1604724bc5d9356be1f03ce.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
ggplot(merge(unwei_unifrac.pcoa$points, metadata, by.x = "row.names", by.y = "Sample.id")) +
geom_point(aes(x = V1, y = V2, color = IMC), size = 3) +
scale_color_viridis_c(option = "C", name = "BMI") +
labs(title = paste("Unweighted UniFrac", res_unweighted),
x = "PCoA1", y = "PCoA2") +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cbar8kmakwi3l_t/d8ba4b3aac4448159a9770fd4a635409.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
# Loop por variável
for (v in vars) {
cat("\n### PERMANOVA for:", v, "###\n")
# Remover NAs só da variável e manter IDs que estão na matriz
ids <- rownames(metadata[!is.na(metadata[[v]]), ])
ids <- intersect(ids, rownames(weighted.unifrac))
# Rodar PERMANOVA direto
result_weighted_permanova <- adonis2(weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
print(result_weighted_permanova)
}
### PERMANOVA for: Region_type ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0802 0.01664 1.8102 0.106
Residual 107 4.7393 0.98336
Total 108 4.8195 1.00000
### PERMANOVA for: Region ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 4 0.2747 0.057 1.5716 0.061 .
Residual 104 4.5448 0.943
Total 108 4.8195 1.000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: IL17A ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.01089 0.00349 0.2624 0.938
Residual 75 3.11208 0.99651
Total 76 3.12297 1.00000
### PERMANOVA for: IFNGamma ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.02533 0.00811 0.6134 0.75
Residual 75 3.09764 0.99189
Total 76 3.12297 1.00000
### PERMANOVA for: TNF ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.03473 0.01112 0.8435 0.46
Residual 75 3.08824 0.98888
Total 76 3.12297 1.00000
### PERMANOVA for: IL10 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.01902 0.00609 0.4597 0.862
Residual 75 3.10395 0.99391
Total 76 3.12297 1.00000
### PERMANOVA for: IL6 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 57 2.45725 0.78683 1.2304 0.16
Residual 19 0.66572 0.21317
Total 76 3.12297 1.00000
### PERMANOVA for: IL4 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.03854 0.01234 0.9371 0.424
Residual 75 3.08443 0.98766
Total 76 3.12297 1.00000
### PERMANOVA for: IL2 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.01799 0.00576 0.4346 0.887
Residual 75 3.10498 0.99424
Total 76 3.12297 1.00000
### PERMANOVA for: Age ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0596 0.01237 1.34 0.203
Residual 107 4.7599 0.98763
Total 108 4.8195 1.00000
### PERMANOVA for: Sex ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0882 0.01829 1.994 0.085 .
Residual 107 4.7313 0.98171
Total 108 4.8195 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Raca ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 4 0.2019 0.04189 1.1368 0.276
Residual 104 4.6176 0.95811
Total 108 4.8195 1.00000
### PERMANOVA for: Fuma ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0282 0.00588 0.6272 0.692
Residual 106 4.7705 0.99412
Total 107 4.7987 1.00000
### PERMANOVA for: Alcool ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0731 0.01524 1.6405 0.128
Residual 106 4.7256 0.98476
Total 107 4.7987 1.00000
### PERMANOVA for: Medicamentos ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0351 0.00732 0.7821 0.558
Residual 106 4.7635 0.99268
Total 107 4.7987 1.00000
### PERMANOVA for: Doenca ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 18 0.70729 0.30916 0.6215 0.952
Residual 25 1.58049 0.69084
Total 43 2.28778 1.00000
### PERMANOVA for: Antibiotico ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0661 0.01377 1.4804 0.162
Residual 106 4.7326 0.98623
Total 107 4.7987 1.00000
### PERMANOVA for: Systolic ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0313 0.00668 0.693 0.616
Residual 103 4.6508 0.99332
Total 104 4.6821 1.00000
### PERMANOVA for: Diastolic ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0299 0.00639 0.6622 0.647
Residual 103 4.6521 0.99361
Total 104 4.6821 1.00000
### PERMANOVA for: Weight ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1064 0.0223 2.395 0.059 .
Residual 105 4.6627 0.9777
Total 106 4.7691 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Height ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0237 0.00496 0.5233 0.785
Residual 105 4.7454 0.99504
Total 106 4.7691 1.00000
### PERMANOVA for: IMC ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0857 0.01797 1.9217 0.09 .
Residual 105 4.6834 0.98203
Total 106 4.7691 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: W.H ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0343 0.0105 0.7538 0.527
Residual 71 3.2296 0.9895
Total 72 3.2639 1.0000
### PERMANOVA for: Parasitologico ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 7 0.3312 0.06945 1.0556 0.372
Residual 99 4.4379 0.93055
Total 106 4.7691 1.00000
### PERMANOVA for: ERITROCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0562 0.01229 1.232 0.253
Residual 99 4.5121 0.98771
Total 100 4.5683 1.00000
### PERMANOVA for: HEMOGLOBINA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0489 0.01071 1.0723 0.303
Residual 99 4.5193 0.98929
Total 100 4.5683 1.00000
### PERMANOVA for: HEMATOCRITO ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0689 0.01509 1.5169 0.16
Residual 99 4.4993 0.98491
Total 100 4.5683 1.00000
### PERMANOVA for: VCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0255 0.00558 0.5558 0.751
Residual 99 4.5428 0.99442
Total 100 4.5683 1.00000
### PERMANOVA for: HCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0225 0.00493 0.4908 0.808
Residual 99 4.5457 0.99507
Total 100 4.5683 1.00000
### PERMANOVA for: CHCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0430 0.0094 0.9398 0.382
Residual 99 4.5253 0.9906
Total 100 4.5683 1.0000
### PERMANOVA for: RDW ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0282 0.00616 0.614 0.661
Residual 99 4.5401 0.99384
Total 100 4.5683 1.00000
### PERMANOVA for: LEUCOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0322 0.00704 0.7021 0.599
Residual 99 4.5361 0.99296
Total 100 4.5683 1.00000
### PERMANOVA for: NEUTROFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0133 0.0029 0.2882 0.971
Residual 99 4.5550 0.9971
Total 100 4.5683 1.0000
### PERMANOVA for: EOSINOFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0456 0.00998 0.9975 0.368
Residual 99 4.5227 0.99002
Total 100 4.5683 1.00000
### PERMANOVA for: BASOFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0777 0.017 1.712 0.126
Residual 99 4.4906 0.983
Total 100 4.5683 1.000
### PERMANOVA for: LINFOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0921 0.02016 2.0371 0.091 .
Residual 99 4.4762 0.97984
Total 100 4.5683 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: MONOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1025 0.02244 2.273 0.05 *
Residual 99 4.4657 0.97756
Total 100 4.5683 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: PLAQUETAS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0216 0.00473 0.471 0.851
Residual 99 4.5466 0.99527
Total 100 4.5683 1.00000
### PERMANOVA for: UREIA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0997 0.02183 2.2099 0.058 .
Residual 99 4.4685 0.97817
Total 100 4.5683 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: CREATININA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0223 0.00489 0.4861 0.666
Residual 99 4.5459 0.99511
Total 100 4.5683 1.00000
### PERMANOVA for: HbA1c ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 23 1.0127 0.22168 0.9535 0.555
Residual 77 3.5556 0.77832
Total 100 4.5683 1.00000
### PERMANOVA for: COLESTEROL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0743 0.01626 1.6366 0.112
Residual 99 4.4940 0.98374
Total 100 4.5683 1.00000
### PERMANOVA for: LDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0747 0.01764 1.6884 0.128
Residual 94 4.1579 0.98236
Total 95 4.2326 1.00000
### PERMANOVA for: HDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0443 0.01046 0.9933 0.392
Residual 94 4.1883 0.98954
Total 95 4.2326 1.00000
### PERMANOVA for: VLDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 28 1.1657 0.2754 0.9095 0.672
Residual 67 3.0669 0.7246
Total 95 4.2326 1.0000
### PERMANOVA for: TRIGLICERIDES ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0697 0.01526 1.5342 0.155
Residual 99 4.4986 0.98474
Total 100 4.5683 1.00000
### PERMANOVA for: TGO ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0536 0.01173 1.1747 0.296
Residual 99 4.5147 0.98827
Total 100 4.5683 1.00000
### PERMANOVA for: TGP ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0244 0.00533 0.5306 0.731
Residual 99 4.5439 0.99467
Total 100 4.5683 1.00000
### PERMANOVA for: GGT ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0626 0.01369 1.3746 0.19
Residual 99 4.5057 0.98631
Total 100 4.5683 1.00000
### PERMANOVA for: GLICOSE ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0464 0.01025 1.0042 0.336
Residual 97 4.4786 0.98975
Total 98 4.5250 1.00000
### PERMANOVA for: INSULINA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.03377 0.01121 0.8162 0.525
Residual 72 2.97882 0.98879
Total 73 3.01259 1.00000
### PERMANOVA for: HOMA.IR ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.03225 0.01083 0.7772 0.522
Residual 71 2.94572 0.98917
Total 72 2.97796 1.00000
### PERMANOVA for: PCR ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = weighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 57 2.50307 0.83087 1.379 0.102
Residual 16 0.50953 0.16913
Total 73 3.01259 1.00000
# Loop por variável
for (v in vars) {
cat("\n### PERMANOVA for:", v, "###\n")
# Remover NAs só da variável e manter IDs que estão na matriz
ids <- rownames(metadata[!is.na(metadata[[v]]), ])
ids <- intersect(ids, rownames(unweighted.unifrac))
# Rodar PERMANOVA direto
result <- adonis2(unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
print(result)
}
### PERMANOVA for: Region_type ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1531 0.0147 1.5961 0.034 *
Residual 107 10.2609 0.9853
Total 108 10.4139 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Region ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 4 0.4323 0.04151 1.1261 0.168
Residual 104 9.9816 0.95849
Total 108 10.4139 1.00000
### PERMANOVA for: IL17A ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0668 0.0096 0.7269 0.836
Residual 75 6.8952 0.9904
Total 76 6.9620 1.0000
### PERMANOVA for: IFNGamma ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0955 0.01372 1.0435 0.348
Residual 75 6.8665 0.98628
Total 76 6.9620 1.00000
### PERMANOVA for: TNF ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.068 0.00977 0.74 0.859
Residual 75 6.894 0.99023
Total 76 6.962 1.00000
### PERMANOVA for: IL10 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0705 0.01012 0.7671 0.823
Residual 75 6.8916 0.98988
Total 76 6.9620 1.00000
### PERMANOVA for: IL6 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 57 5.3256 0.76494 1.0848 0.149
Residual 19 1.6365 0.23506
Total 76 6.9620 1.00000
### PERMANOVA for: IL4 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1514 0.02175 1.6678 0.029 *
Residual 75 6.8106 0.97825
Total 76 6.9620 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: IL2 ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1107 0.0159 1.212 0.173
Residual 75 6.8513 0.9841
Total 76 6.9620 1.0000
### PERMANOVA for: Age ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0982 0.00943 1.0188 0.368
Residual 107 10.3157 0.99057
Total 108 10.4139 1.00000
### PERMANOVA for: Sex ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1166 0.0112 1.2121 0.169
Residual 107 10.2973 0.9888
Total 108 10.4139 1.0000
### PERMANOVA for: Raca ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 4 0.451 0.0433 1.1768 0.099 .
Residual 104 9.963 0.9567
Total 108 10.414 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Fuma ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0806 0.00779 0.8322 0.714
Residual 106 10.2670 0.99221
Total 107 10.3476 1.00000
### PERMANOVA for: Alcool ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1614 0.0156 1.6795 0.029 *
Residual 106 10.1862 0.9844
Total 107 10.3476 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Medicamentos ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0844 0.00815 0.8712 0.653
Residual 106 10.2632 0.99185
Total 107 10.3476 1.00000
### PERMANOVA for: Doenca ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 18 1.8039 0.43674 1.0769 0.21
Residual 25 2.3264 0.56326
Total 43 4.1303 1.00000
### PERMANOVA for: Antibiotico ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0671 0.00649 0.6923 0.944
Residual 106 10.2804 0.99351
Total 107 10.3476 1.00000
### PERMANOVA for: Systolic ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0764 0.00766 0.7947 0.799
Residual 103 9.9018 0.99234
Total 104 9.9782 1.00000
### PERMANOVA for: Diastolic ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0795 0.00797 0.8271 0.743
Residual 103 9.8987 0.99203
Total 104 9.9782 1.00000
### PERMANOVA for: Weight ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1401 0.0137 1.4584 0.065 .
Residual 105 10.0897 0.9863
Total 106 10.2299 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: Height ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0909 0.00889 0.9418 0.5
Residual 105 10.1389 0.99111
Total 106 10.2299 1.00000
### PERMANOVA for: IMC ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1489 0.01456 1.5511 0.041 *
Residual 105 10.0809 0.98544
Total 106 10.2299 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: W.H ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1268 0.01877 1.3583 0.103
Residual 71 6.6269 0.98123
Total 72 6.7536 1.00000
### PERMANOVA for: Parasitologico ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 7 0.6711 0.0656 0.9929 0.469
Residual 99 9.5588 0.9344
Total 106 10.2299 1.0000
### PERMANOVA for: ERITROCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0859 0.00889 0.8883 0.622
Residual 99 9.5735 0.99111
Total 100 9.6594 1.00000
### PERMANOVA for: HEMOGLOBINA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0862 0.00893 0.8916 0.621
Residual 99 9.5732 0.99107
Total 100 9.6594 1.00000
### PERMANOVA for: HEMATOCRITO ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0897 0.00929 0.9283 0.515
Residual 99 9.5697 0.99071
Total 100 9.6594 1.00000
### PERMANOVA for: VCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0960 0.00994 0.9938 0.419
Residual 99 9.5634 0.99006
Total 100 9.6594 1.00000
### PERMANOVA for: HCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0865 0.00895 0.8945 0.6
Residual 99 9.5729 0.99105
Total 100 9.6594 1.00000
### PERMANOVA for: CHCM ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0725 0.00751 0.749 0.881
Residual 99 9.5869 0.99249
Total 100 9.6594 1.00000
### PERMANOVA for: RDW ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0736 0.00762 0.7604 0.838
Residual 99 9.5858 0.99238
Total 100 9.6594 1.00000
### PERMANOVA for: LEUCOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0654 0.00677 0.6749 0.96
Residual 99 9.5940 0.99323
Total 100 9.6594 1.00000
### PERMANOVA for: NEUTROFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0555 0.00574 0.572 0.993
Residual 99 9.6039 0.99426
Total 100 9.6594 1.00000
### PERMANOVA for: EOSINOFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1195 0.01237 1.2401 0.166
Residual 99 9.5399 0.98763
Total 100 9.6594 1.00000
### PERMANOVA for: BASOFILOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1338 0.01386 1.391 0.085 .
Residual 99 9.5256 0.98614
Total 100 9.6594 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: LINFOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1631 0.01689 1.7005 0.022 *
Residual 99 9.4963 0.98311
Total 100 9.6594 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: MONOCITOS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0753 0.00779 0.7776 0.804
Residual 99 9.5841 0.99221
Total 100 9.6594 1.00000
### PERMANOVA for: PLAQUETAS ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0847 0.00877 0.8761 0.631
Residual 99 9.5747 0.99123
Total 100 9.6594 1.00000
### PERMANOVA for: UREIA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1313 0.01359 1.3643 0.099 .
Residual 99 9.5281 0.98641
Total 100 9.6594 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: CREATININA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0874 0.00905 0.9044 0.511
Residual 99 9.5720 0.99095
Total 100 9.6594 1.00000
### PERMANOVA for: HbA1c ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 23 2.4637 0.25506 1.1463 0.026 *
Residual 77 7.1957 0.74494
Total 100 9.6594 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: COLESTEROL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1064 0.01102 1.1028 0.265
Residual 99 9.5530 0.98898
Total 100 9.6594 1.00000
### PERMANOVA for: LDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0972 0.01069 1.0156 0.405
Residual 94 8.9940 0.98931
Total 95 9.0912 1.00000
### PERMANOVA for: HDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0851 0.00936 0.8883 0.62
Residual 94 9.0061 0.99064
Total 95 9.0912 1.00000
### PERMANOVA for: VLDL ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 28 2.6482 0.29129 0.9835 0.594
Residual 67 6.4431 0.70871
Total 95 9.0912 1.00000
### PERMANOVA for: TRIGLICERIDES ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1313 0.0136 1.3646 0.095 .
Residual 99 9.5281 0.9864
Total 100 9.6594 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: TGO ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1127 0.01167 1.1691 0.221
Residual 99 9.5467 0.98833
Total 100 9.6594 1.00000
### PERMANOVA for: TGP ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0739 0.00766 0.7637 0.777
Residual 99 9.5855 0.99234
Total 100 9.6594 1.00000
### PERMANOVA for: GGT ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.0919 0.00952 0.9512 0.513
Residual 99 9.5675 0.99048
Total 100 9.6594 1.00000
### PERMANOVA for: GLICOSE ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1213 0.01275 1.2529 0.157
Residual 97 9.3924 0.98725
Total 98 9.5137 1.00000
### PERMANOVA for: INSULINA ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1235 0.01834 1.3454 0.098 .
Residual 72 6.6070 0.98166
Total 73 6.7304 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
### PERMANOVA for: HOMA.IR ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 1 0.1172 0.01757 1.2696 0.132
Residual 71 6.5530 0.98243
Total 72 6.6701 1.00000
### PERMANOVA for: PCR ###
Permutation test for adonis under reduced model
Permutation: free
Number of permutations: 999
adonis2(formula = unweighted.unifrac[ids, ids] ~ metadata[ids, v], permutations = 999)
Df SumOfSqs R2 F Pr(>F)
Model 57 5.0606 0.75189 0.8507 0.975
Residual 16 1.6699 0.24811
Total 73 6.7304 1.00000
expl_var_jaccard
[1] 7.9 3.7 3.7
expl_var_bray
[1] 13.2 6.1 5.9
ggplot(pcoa_points_jaccard, aes(x = Axis.1, y = Axis.2)) +
geom_point(size = 2) +
labs(title = "PCoA — Jaccard",
x = paste0("PCoA1 (", expl_var_jaccard[1], "%)"),
y = paste0("PCoA2 (", expl_var_jaccard[2], "%)")) +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587F21ebe5f4/cpmzxns7s4eoj_t/5d5a7be414f94decbd21a194de2055a3.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
# Gráfico com cor fixa
ggplot(pcoa_points_jaccard, aes(x = Axis.1, y = Axis.2)) +
geom_point(color = cor_escura, size = 3) +
labs(title = "PCoA — Jaccard",
x = paste0("PCoA1 (", expl_var_jaccard[1], "%)"),
y = paste0("PCoA2 (", expl_var_jaccard[2], "%)")) +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587F21ebe5f4/c91rf7bfzc4y2_t/51ae143951f7472db75fc5655635d328.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
# Gráfico Bray-Curtis
ggplot(pcoa_points_bray, aes(x = Axis.1, y = Axis.2)) +
geom_point(color = cor_escura, size = 3) +
labs(title = "PCoA — Bray-Curtis",
x = paste0("PCoA1 (", expl_var_bray[1], "%)"),
y = paste0("PCoA2 (", expl_var_bray[2], "%)")) +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587F21ebe5f4/c7lejey36yksu_t/50d871b960a945f0b8626daedeb241c7.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
ggplot(merged_jaccard, aes(x = Axis.1, y = Axis.2, color = Region)) +
geom_point(size = 3) +
scale_color_viridis_d(option = "C", name = "Region") +
labs(title = "PCoA — Jaccard",
x = paste0("PCoA1 (", expl_var_jaccard[1], "%)"),
y = paste0("PCoA2 (", expl_var_jaccard[2], "%)")) +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587F21ebe5f4/cp0gqeku63hq2_t/509c1633663b4f9190834fa1c471f8ce.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
ggplot(merged_bray, aes(x = Axis.1, y = Axis.2, color = Region)) +
geom_point(size = 3) +
scale_color_viridis_d(option = "C", name = "Region") +
labs(title = "PCoA — Bray-Curtis",
x = paste0("PCoA1 (", expl_var_bray[1], "%)"),
y = paste0("PCoA2 (", expl_var_bray[2], "%)")) +
theme_minimal()
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587F21ebe5f4/cnxu9euouk8jm_t/f9540fc451af45c1b0153d7c76b42ca5.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
#====================# Alpha Diversidade #===================#
#==========================# ALPHA DIVERSITY #=========================#
# Selecionar as colunas numéricas de interesse e renomeá-las para metadados_shannon_selected
metadados.saude.alpha <- metadados.all %>%
select("shannon_entropy", "simpson", "pielou_evenness", "observed_features", "ACE", "chao1", "faith_pd","Age" "BMI", "WHR", "TyG", "VAI", "QUICKI", "METS_IR", "TyG_BMI", "TyG_WC", "IL17A", "IFNGamma" , "HbA1c", "GLICOSE", "INSULINA", "HOMA.IR", "Systolic", "Diastolic", "COLESTEROL", "LDL", "HDL", "VLDL" , "TRIGLICERIDES" , "TGO", "TGP", "GGT", "PCR", "TNF", "IFNGamma" , "IL2", "IL4", "IL6", "IL10", )
Erro: unexpected string constant em:
"metadados.saude.alpha <- metadados.all %>%
select("shannon_entropy", "simpson", "pielou_evenness", "observed_features", "ACE", "chao1", "faith_pd","Age" "BMI""
# Plot com ggplot2
ggplot(df_plot_saude, aes(Var1, Var2, fill = cor)) +
geom_tile(color = "white") +
scale_fill_gradient2(low = "blue", high = "red", mid = "white",
midpoint = 0, limit = c(-1, 1), name = "Spearman") +
geom_text(aes(label = asterisks), size = 3) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
axis.text.y = element_text(size = 8),
panel.grid = element_blank()) +
coord_fixed() +
labs(title = "Alpha Diversity and Health (FDR ajustado)", x = "", y = "")
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cnysny5p8aobl_t/664a7f4fc35e451faf89eceea05689b1.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
# Gera o heatmap com ggplot2
ggplot(df_plot_dieta, aes(Var1, Var2, fill = cor)) +
geom_tile(color = "white") +
scale_fill_gradient2(low = "blue", high = "red", mid = "white",
midpoint = 0, limit = c(-1, 1), name = "Spearman") +
geom_text(aes(label = asterisks), size = 3) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
axis.text.y = element_text(size = 8),
panel.grid = element_blank()) +
coord_fixed() +
labs(title = "Alpha Diversity and Diet (FDR ajustado)", x = "", y = "")
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/ch8yyk6j3f6m9_t/dfa7db5469a34f11bca8ad3c55d2e391.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
library(ggplot2)
library(reshape2)
# Calcula correlação de Spearman e p-valores entre todas as variáveis do índice de dieta
cor_test_results_diet_index <- suppressWarnings({
do.call(rbind, lapply(colnames(metadados.diet.index.alpha), function(x) {
sapply(colnames(metadados.diet.index.alpha), function(y) {
test <- cor.test(metadados.diet.index.alpha[[x]], metadados.diet.index.alpha[[y]], method = "spearman")
c(cor = test$estimate, p = test$p.value)
})
}))
})
# Cria matrizes de correlação e p-valores
n_diet_index <- length(colnames(metadados.diet.index.alpha))
cor_matrix_diet_index <- matrix(cor_test_results_diet_index[seq(1, n_diet_index^2 * 2, by = 2)], ncol = n_diet_index)
p_matrix_diet_index <- matrix(cor_test_results_diet_index[seq(2, n_diet_index^2 * 2, by = 2)], ncol = n_diet_index)
colnames(cor_matrix_diet_index) <- rownames(cor_matrix_diet_index) <- colnames(metadados.diet.index.alpha)
colnames(p_matrix_diet_index) <- rownames(p_matrix_diet_index) <- colnames(metadados.diet.index.alpha)
# Aplica FDR (Benjamini-Hochberg)
p_adjusted_diet_index <- matrix(p.adjust(as.vector(p_matrix_diet_index), method = "fdr"), ncol = n_diet_index)
colnames(p_adjusted_diet_index) <- colnames(p_matrix_diet_index)
rownames(p_adjusted_diet_index) <- rownames(p_matrix_diet_index)
# Gera matriz de asteriscos de significância
asterisks_diet_index <- ifelse(p_adjusted_diet_index < 0.001, "***",
ifelse(p_adjusted_diet_index < 0.01, "**",
ifelse(p_adjusted_diet_index < 0.05, "*", "")))
# Prepara dados para o ggplot
df_plot_diet_index <- melt(cor_matrix_diet_index)
colnames(df_plot_diet_index) <- c("Var1", "Var2", "cor")
df_plot_diet_index$p <- melt(p_adjusted_diet_index)[, 3]
df_plot_diet_index$asterisks <- melt(asterisks_diet_index)[, 3]
# Gera o heatmap
ggplot(df_plot_diet_index, aes(Var1, Var2, fill = cor)) +
geom_tile(color = "white") +
scale_fill_gradient2(low = "blue", high = "red", mid = "white",
midpoint = 0, limit = c(-1, 1), name = "Spearman") +
geom_text(aes(label = asterisks), size = 3) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1),
axis.text.y = element_text(size = 8),
panel.grid = element_blank()) +
coord_fixed() +
labs(title = "Alpha Diversity and Diet Index (FDR ajustado)", x = "", y = "")
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/clq4msth9bnfv_t/fc53cdda522a40a3bfffb3808870617d.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
#=================================# Alpha com BHEI-R #=================================#
library(ggplot2)
library(dplyr)
library(ggpubr)
library(ggsci) # algumas paletas extras
library(viridis) # essa é a principal!
table(metadados.diet.index.alpha$BHEI_category, useNA = "always")
Poor diet quality Needs improvement Good diet quality <NA>
40 69 0 0
tercis
0% 33.33333% 66.66667% 100%
21.49 49.33 57.92 77.80
# Kruskal-Wallis geral para cada índice
kw_shannon <- kruskal.test(shannon_entropy ~ BHEI_category, data = metadados.diet.index.alpha)$p.value
kw_pielou <- kruskal.test(pielou_evenness ~ BHEI_category, data = metadados.diet.index.alpha)$p.value
kw_chao1 <- kruskal.test(chao1 ~ BHEI_category, data = metadados.diet.index.alpha)$p.value
kw_faith <- kruskal.test(faith_pd ~ BHEI_category, data = metadados.diet.index.alpha)$p.value
library(ggpubr)
# Shannon
p1 <- ggboxplot(metadados.diet.index.alpha, x = "BHEI_category", y = "shannon_entropy",
fill = "BHEI_category", palette = "viridis") +
labs(title = paste0("A. Shannon Entropy (Kruskal-Wallis p = ", signif(kw_shannon, 3), ")"),
x = "Diet Quality", y = "Shannon Entropy") +
stat_pvalue_manual(comparacoes_bhei_shannon, label = "p.signif", tip.length = 0.01) +
theme_minimal()
# Pielou
p2 <- ggboxplot(metadados.diet.index.alpha, x = "BHEI_category", y = "pielou_evenness",
fill = "BHEI_category", palette = "viridis") +
labs(title = paste0("B. Pielou Evenness (Kruskal-Wallis p = ", signif(kw_pielou, 3), ")"),
x = "Diet Quality", y = "Pielou Index") +
stat_pvalue_manual(comparacoes_bhei_pielou, label = "p.signif", tip.length = 0.01) +
theme_minimal()
# Chao1
p3 <- ggboxplot(metadados.diet.index.alpha, x = "BHEI_category", y = "chao1",
fill = "BHEI_category", palette = "viridis") +
labs(title = paste0("C. Chao1 Richness (Kruskal-Wallis p = ", signif(kw_chao1, 3), ")"),
x = "Diet Quality", y = "Chao1 Richness") +
stat_pvalue_manual(comparacoes_bhei_chao1, label = "p.signif", tip.length = 0.01) +
theme_minimal()
# Faith's PD
p4 <- ggboxplot(metadados.diet.index.alpha, x = "BHEI_category", y = "faith_pd",
fill = "BHEI_category", palette = "viridis") +
labs(title = paste0("D. Faith's PD (Kruskal-Wallis p = ", signif(kw_faith, 3), ")"),
x = "Diet Quality", y = "Faith's Phylogenetic Diversity") +
stat_pvalue_manual(comparacoes_bhei_faith, label = "p.signif", tip.length = 0.01) +
theme_minimal()
painel_bhei_final
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cob4z772q8msq_t/4defbd846fb54884ab79438a6641fa44.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
#===============================================# alpha x vegetable_oils_nuts_fishoil_score #===============================================#
kruskal.test(chao1 ~ gordura_boa_categoria, data = metadados.diet.index.alpha)
Kruskal-Wallis rank sum test
data: chao1 by gordura_boa_categoria
Kruskal-Wallis chi-squared = 9.6712, df = 1, p-value = 0.001872
painel_gordura_binario
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cczu9t4brgt4w_t/dc1c4e7a48264a79b2e9bf0d8cf031de.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
library(dplyr)
metadados.dieta.residual.alpha <- metadados.dieta.residual.alpha %>%
mutate(
tercil_saturados = ntile(acidos_graxos_saturados_g, 3),
tercil_trans = ntile(acidos_graxos_trans_g, 3),
tercil_colesterol = ntile(colesterol_mg, 3)
) %>%
mutate(
tercil_saturados = factor(tercil_saturados, labels = c("Low", "Medium", "High")),
tercil_trans = factor(tercil_trans, labels = c("Low", "Medium", "High")),
tercil_colesterol = factor(tercil_colesterol, labels = c("Low", "Medium", "High"))
)
#===================================================# Alpha e Saturated Fat #===================================================#
painel_saturado
Aviso em gzfile(file, "wb") :
não foi possível abrir o arquivo comprimido 'C:/Users/polia/OneDrive/Desktop/EstatisticaR/AgrUrbana/16S_AgriUrbana/AgriculturaUrbana_Analises/AnalisesAgriUrbana/.Rproj.user/shared/notebooks/AF6D5EA6-PS_URBANAGRI_5016_Alpha_Beta_N100_14_03_2025/1/4E7A587Ff595eb3c/cb0srmz2l4mxj_t/1bd1db5ca121474ea3f66cb1a2824706.snapshot', motivo provável 'No such file or directory'
Error in gzfile(file, "wb") : não é possível abrir a conexão
#============# Gordura Trans #============#
comparacoes_trans_faith <- compare_means(faith_pd ~ tercil_trans, data = metadados.dieta.residual.alpha, method = "wilcox.test", p.adjust.method = "fdr") %>%
filter(p.adj <= 0.05) %>%
mutate(y.position = c(24, 26, 28))
Error in `mutate()`:
ℹ In argument: `y.position = c(24, 26, 28)`.
Caused by error:
! `y.position` must be size 1, not 3.
Backtrace:
1. ... %>% mutate(y.position = c(24, 26, 28))
9. dplyr:::dplyr_internal_error(...)
#=====================================# Colesterol #====================================#
# Função para comparar com FDR e retornar apenas significativos com posição y
get_comparacoes <- function(var, y_pos) {
comp <- compare_means(as.formula(paste0(var, " ~ tercil_colesterol")),
data = metadados.dieta.residual.alpha,
method = "wilcox.test", p.adjust.method = "fdr")
comp_sig <- comp %>% filter(p.adj <= 0.05)
if (nrow(comp_sig) > 0) {
comp_sig$y.position <- y_pos[1:nrow(comp_sig)]
return(comp_sig)
} else {
return(NULL)
}
}
# Kruskal-Wallis geral
kw_colesterol_shannon <- kruskal.test(shannon_entropy ~ tercil_colesterol, data = metadados.dieta.residual.alpha)$p.value
kw_colesterol_pielou <- kruskal.test(pielou_evenness ~ tercil_colesterol, data = metadados.dieta.residual.alpha)$p.value
kw_colesterol_chao1 <- kruskal.test(chao1 ~ tercil_colesterol, data = metadados.dieta.residual.alpha)$p.value
kw_colesterol_faith <- kruskal.test(faith_pd ~ tercil_colesterol, data = metadados.dieta.residual.alpha)$p.value
# Comparações com Wilcoxon
comparacoes_col_shannon <- get_comparacoes("shannon_entropy", c(7.2, 7.4, 7.6))
comparacoes_col_pielou <- get_comparacoes("pielou_evenness", c(0.88, 0.91, 0.94))
comparacoes_col_chao1 <- get_comparacoes("chao1", c(420, 440, 460))
comparacoes_col_faith <- get_comparacoes("faith_pd", c(24, 26, 28))
# Gráfico Shannon
p1_col <- ggboxplot(metadados.dieta.residual.alpha, x = "tercil_colesterol", y = "shannon_entropy",
fill = "tercil_colesterol", palette = "viridis") +
labs(title = paste0("A. Shannon Entropy (Kruskal-Wallis p = ", signif(kw_colesterol_shannon, 3), ")"),
x = "Cholesterol Intake (tercile)", y = "Shannon Entropy") +
theme_minimal()
if (!is.null(comparacoes_col_shannon)) {
p1_col <- p1_col + stat_pvalue_manual(comparacoes_col_shannon, label = "p.signif", tip.length = 0.01)
}
# Gráfico Pielou
p2_col <- ggboxplot(metadados.dieta.residual.alpha, x = "tercil_colesterol", y = "pielou_evenness",
fill = "tercil_colesterol", palette = "viridis") +
labs(title = paste0("B. Pielou Evenness (Kruskal-Wallis p = ", signif(kw_colesterol_pielou, 3), ")"),
x = "Cholesterol Intake (tercile)", y = "Pielou Index") +
theme_minimal()
if (!is.null(comparacoes_col_pielou)) {
p2_col <- p2_col + stat_pvalue_manual(comparacoes_col_pielou, label = "p.signif", tip.length = 0.01)
}
# Gráfico Chao1
p3_col <- ggboxplot(metadados.dieta.residual.alpha, x = "tercil_colesterol", y = "chao1",
fill = "tercil_colesterol", palette = "viridis") +
labs(title = paste0("C. Chao1 Richness (Kruskal-Wallis p = ", signif(kw_colesterol_chao1, 3), ")"),
x = "Cholesterol Intake (tercile)", y = "Chao1 Richness") +
theme_minimal()
if (!is.null(comparacoes_col_chao1)) {
p3_col <- p3_col + stat_pvalue_manual(comparacoes_col_chao1, label = "p.signif", tip.length = 0.01)
}
# Gráfico Faith's PD
p4_col <- ggboxplot(metadados.dieta.residual.alpha, x = "tercil_colesterol", y = "faith_pd",
fill = "tercil_colesterol", palette = "viridis") +
labs(title = paste0("D. Faith's PD (Kruskal-Wallis p = ", signif(kw_colesterol_faith, 3), ")"),
x = "Cholesterol Intake (tercile)", y = "Faith's Phylogenetic Diversity") +
theme_minimal()
if (!is.null(comparacoes_col_faith)) {
p4_col <- p4_col + stat_pvalue_manual(comparacoes_col_faith, label = "p.signif", tip.length = 0.01)
}
# Juntar os gráficos
painel_colesterol_final <- ggarrange(p1_col, p2_col, p3_col, p4_col,
ncol = 2, nrow = 2,
common.legend = TRUE, legend = "bottom")
# Salvar
ggsave("painel_colesterol_significativo.png", painel_colesterol_final, width = 12, height = 8, dpi = 300)